from django.urls import include, path
from rest_framework.routers import DefaultRouter
from rest_framework_simplejwt.views import TokenVerifyView
from .views import UserProfileViewSet, RegisterView, CustomTokenObtainPairView,LogoutView, SendVerificationCode, ResetPassword, GetCSRFToken

router = DefaultRouter()
router.register(r'auth', UserProfileViewSet)

urlpatterns = [
    path('', include(router.urls)),
    # 注册路由
    path('register/', RegisterView.as_view(), name='register'),
    # 登录路由（使用JWT示例）
    path('login/', CustomTokenObtainPairView.as_view(), name='token_obtain_pair'),
    # 注销路由
    path('logout/', LogoutView.as_view(), name='logout'),
    #验证令牌路由
    path('validate-token/', TokenVerifyView.as_view(), name='token_verify'),
    # 发送验证码路由
    path('send_verification_code/', SendVerificationCode.as_view(), name='send_verification_code'),
    # 重置密码路由
    path('reset_password/',ResetPassword.as_view(), name='reset_password'),
    # 获取CSRF token
    path('get_csrf_token/', GetCSRFToken.as_view(), name='get-csrf-token'),
]
